import math

def getPrimes(x) :
    ret = []
    i = 2
    while i<=math.sqrt(x) :
        while x%i==0 :
            ret.append(i)
            x = x//i
        i = i+1
    if x>1 :
        ret.append(x)
    return ret

while True :
    print(*getPrimes(int(input())))
